# -*- coding: UTF-8 -*-
import pytest

from Interface.MemberInterface.Memberinterface import MemberInterface
from Interface.UserInterface.LogInterface import LoginInterface
from Utiles.GetKeywords import GetKeywords
from Interface.SalesInterface.SalesInterface import SalesInterface
from Utiles.Database import Database

@pytest.fixture
def login():
    return LoginInterface()


@pytest.fixture()
def member():
    return MemberInterface(headers=headers())


@pytest.fixture()
def sales():
    return SalesInterface(headers=headers())

@pytest.fixture()
def db():
    return Database()


def headers():
    login = LoginInterface()
    res = login.tenant_login("jsh", "123456")
    token = GetKeywords.get_keyword(res, "token")
    return {"x-access-token": token}
